<form onsubmit="return false" id="mws-validate" class="mws-form">
    <div class="mws-form-inline">
        <?php
        if ($data != "") {
            ?>
            <div class="mws-form-row">
                <label>Tipo Saída</label>
                <div class="mws-form-item small">
                    <select class="required input-small campo-150 select-img" id="tipo" name="tipo">
                        <option value="">Ação</option>
                        <?php
                        foreach ($data[1] as $tipo) {
                            echo "<option value='" . $tipo->codigo . "'";

                            if (isset($_POST["tipo"])) {
                                if ($_POST["tipo"] == $tipo->codigo) {
                                    echo "SELECTED ";
                                }
                            }

                            echo " style='background: url(" . BASE_URL . "uploads/" . $tipo->imagem . ") no-repeat;' class='img-select'>" . $tipo->descricao . "</option>";
                        }
                        ?>
                    </select>
                </div>
            </div>
            <?php
        }
        ?>
        <div class="mws-form-row">
            <label>Valor</label>
            <div class="mws-form-item small">
                <input type="text" name="valor" id="valor" class="mws-textinput required input-small"
                <?php
                if (isset($_POST["valor"])) {
                    echo "value='" . $_POST['valor'] . "'";
                }
                ?>>
            </div>
        </div>

        <div class="mws-form-row">
            <label>Descricao</label>
            <div class="mws-form-item small">

                <textarea name="descricao" id="descricao" class="descricao-saida" maxlength="40" rows="1" ><?php
                    if (isset($_POST["descricao"])) {
                        echo $_POST['descricao'];
                    }
                    ?></textarea>

            </div>
        </div>
    </div>
</form>
<script type="text/javascript">
    $("#valor").maskMoney({symbol: "R$", decimal: ".", thousands: ""});
</script>